package thread;

import java.awt.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) throws IOException {
//        System.out.println("程序开始了");
//        try {
//            Thread.sleep(5000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//        System.out.println("程序结束了");
       /* System.out.println("请输入一个整数...");
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();*/
        BufferedReader br = new BufferedReader(
                new InputStreamReader(
                        System.in
                )
        );
        System.out.println("请输入一个整数...");
        int num = Integer.parseInt(br.readLine());
        for (int i = num;i>0;i--){
            System.out.println(i);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println("时间到");
    }
}
